
package com.welsy.iter.business
{
	import mx.rpc.Fault;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.soap.mxml.WebService;	
	import mx.rpc.AbstractOperation;
	import com.adobe.cairngorm.business.ServiceLocator;
	import mx.rpc.IResponder;
	import mx.rpc.AsyncToken;
	import flash.utils.setTimeout;

	/**
	  * @author Welsy.org
	  * @version	$Revision: 1.1 $
	  */
	public class RemoveIterDelegate
	{
		/**
		  * Delegate initialization for course component retrieval
		  * @param responder The event handler fo the server response
		  */
		public function RemoveIterDelegate( responder : IResponder )
		{		
			this.service = ServiceLocator.getInstance().getWebService("iterServices") as WebService;
			
			this.responder = responder;
		}
										
		/**
		  * Retrieve from the server the components for a given course
		  * @param id The ID of the course which owns the components
		  */
		public function removeIterComponents( iterId : String ) : void
		{	
					
			var o:AbstractOperation = service.getOperation("RemoveIter");
			o.arguments.RemoveIterRequest.IterId = iterId;
			
			var token:AsyncToken = service.RemoveIter();
			// notify this command when the service call completes
			token.addResponder( responder );
		}	
		
		private var responder : IResponder;
		private var service : Object;
	}

}